// 确认用户身份为管理员
function userconfirm() {
    jQuery.ajax({
        url: "/user/userconfirm",
        type: "GET",
        data: {},
        success: function(result) {
            if(result == null && result.code != 200) {
            alert("身份验证失败！");
            }
        },
    });
}
function getCount(userCount, noteCount, readCount, commentCount) {
    jQuery.ajax({
        url: "/user/usercount",
        type: "GET",
        data: {},
        success: function(result) {
            if(result != null && result.code == 200) {
              userCount.textContent = result.data;
            }else {
                alert("用户数量加载失败！请刷新重试");
            }
        },
        error: function(xhr, status, error) {
            console.error("请求失败：" + error);
        }
        
    });
    jQuery.ajax({
        url: "/art/notecount",
        type: "GET",
        data: {},
        success: function(result) {
            if(result != null && result.code == 200) {
              noteCount.textContent = result.data;
            }else {
              alert("笔记数量加载失败！请刷新重试");
            }
        },
        error: function(xhr, status, error) {
            console.error("请求失败：" + error);
        }
        
    });
    jQuery.ajax({
        url: "/art/readcount",
        type: "GET",
        data: {},
        success: function(result) {
            if(result != null && result.code == 200) {
              readCount.textContent = result.data;
            }else {
              alert("浏览次数加载失败！请刷新重试");
            }
        },
        error: function(xhr, status, error) {
            console.error("请求失败：" + error);
        }
        
    });
    jQuery.ajax({
        url: "/comment/count",
        type: "GET",
        data: {},
        success: function(result) {
            if(result != null && result.code == 200) {
              commentCount.textContent = result.data;
            }else {
              alert("留言次数加载失败！请刷新重试");
            }
        },
        error: function(xhr, status, error) {
            console.error("请求失败：" + error);
        }
        
    });
}